package com.oceansoft.mobile.common.util;

import java.io.UnsupportedEncodingException;

public class URLTools {
	
	public static  String urlEncodeUTF8	(String url){
		try {
			url=java.net.URLEncoder.encode(url,"utf-8");
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}
		return url;
	}
	

	/**
	 * https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxaec9e61bdd3f83cb&redirect_uri=http%3A%2F%2F221.224.33.76%2Foswechat%2FoauthServlet?userid=ojZW0uHBLiCXBHQgwQb7KC-PndlQ&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirect
	 * @param args
	 */
	public static void main(String[] args) {
		String url="http://221.224.33.76/oswechat/oauthServlet/oauth.do";
		System.out.println(urlEncodeUTF8(url));

	}

}
